This is not set in stone. It is completely possible for large changes to occur suddenly, they just aren't thought to be the main driving force of evolution. (Of course, this discussion also depends on what you mean by "gradual".)
As far as I can see, when we are talking about groups of cells, it's a question of specialisation. Single-celled creatures reproduce by division*. In a population of your typical single-celled organism, every cell is capable of dividing. But what happens if single cells evolve into simple colonies? (Say, because it
helps them escape predators)
At first, the cells in the colony would probably be identical. (Although not necessarily - I once read a
modelling study arguing that cell differentiation itself may be a selective pressure favouring multicellularity!) So every one of them would be able to divide - and then the daughter cells could remain in the colony, or go off to found their own colonies.
However, if you are in a group of genetically identical or closely related cells, it can pay to specialise on a particular function at the expense of others. For example, while a cell is dividing, it can't eat or move very well, and vice versa. Adaptations that would make a cell very good at one thing could impair its ability to do other things.
A single-celled creature can't afford to turn into a feeding machine and lose its ability to divide, but in a colony, groups of cells can become super good at particular jobs while other cells take care of the rest. (A non-dividing cell in a colony is still passing on its genes by trusting reproduction to its clones!)
The full story would be a little more complicated than that, as there's sex involved, and there's the issue of cells that divide to replenish specialised tissues versus cells that divide to give rise to new organisms, but basically, I'd say groups of cells started "laying eggs" by dividing up their functions. Of course, once "eggs", as in specialised reproductive cells, exist, evolution can elaborate them depending on the challenges faced by a particular organism. Amounts of yolk, tough shells, etc. etc. are such elaborations.
*The process of cell division varies greatly in complexity, BTW.
Some mutant bacteria are capable of dividing using basic physical forces, something that the first precursors of modern cells may have done, whereas your own cells (or typical bacteria, for that matter) can't do anything without complex protein machinery.
First of all, live birth and sexual intercourse are two separate things. Internal fertilisation is necessary for live birth, but some form of the former - with or without intercourse - also occurs in many creatures that lay eggs afterwards (egg-laying mammals, mentioned above, being a prime example).
The simplest way to get eggs fertilised is, of course, to spill them into the water and let a male of your species squirt sperm in their general direction. Most aquatic animals do just fine with this strategy. There are various ways of getting sperm inside the female
before she lays her eggs. This is necessary for land animals that reproduce sexually, because sperm cells need a liquid to swim in in order to reach their target. But there are a few different ways of achieving it.
In some amphibians (
these gorgeous salamanders being one of them), males just plop a little package on the ground and then try to get their mate to pick it up with her cloaca. In most birds, mating is little more than touching their cloacas together while the male squirts out his goodies. Of course, the most sophisticated and most effective method of internal fertilisation is developing some sort of specialised organ to stick inside the female, as close to her precious eggs as possible. But once you have a mating system like the basic bird one, an "inflatable" extension of your cloaca (a.k.a. a penis) is not that big of a leap!
(N.B. birds and mammals are on separate branches of the family tree of land vertebrates. Their common ancestor can be pretty certainly inferred to have laid eggs on land and used internal fertilisation, but you can't regard birds as "ancestral" to mammals. I don't know where in their evolutionary history mammals invented intercourse, or indeed whether birds didn't have penises to begin with or originally had them and lost them for some reason.)
Male and female organisms are a consequence of something called anisogamy - having two types of sex cells with different sizes. Sperm and eggs (or pollen or seeds*, or what have you) are basically two different reproductive strategies. You could say that sperm cells go for quantity over quality - they're not fat enough to sustain a developing embryo out of their own resources, but there's a heck of a lot of them. Eggs, you can make fewer for the same cost, but you put enough stuff in them to make sure that if they are fertilised, they will develop.
I'm not sure why such a division is a good idea in the first place - maybe it starts by having larger proto-eggs to better provision your babies, and then being able to exploit others' big fat eggs by producing tons of cheap little proto-sperm. How you go from hermaphrodites who can become more or less "male" or "female" depending on circumstances to strictly separate sexes, I also don't know. (I recall that this has been studied quite extensively in flowering plants, which have pretty varied breeding systems in this regard.)
However, the moment you have separate sexes, all sorts of evolutionary shenanigans ensue because of the different costs of parenthood for males and females...
*Although technically, pollen is NOT an equivalent of sperm. Pollen grains are the ultimate, reduced form of a
stage in plant life that's a whole separate plant in groups such as mosses. Same goes for seeds, although seeds are a bit more than just the female gametophyte. Plant sex makes my head hurt.
Huh?
It doesn't take a lot of faith - but it does take a lot of hard work to understand the evidence. Here I must warn you that I'm not well read in the literature around the evolution of sex, sex differences, sexual selection/conflict and alla that. I think it's absolutely fascinating, but it's definitely Not My Field
(Also, there's nothing to say that you can't believe in God
and study evolution. Just ask our own sfs, because you'll probably find that a little suspicious coming from godless scum like me

)