Hens do not need a rooster to lay eggs. In fact, almost every egg on the grocery store shelves was laid by a hen that did not have access to a rooster! It just doesn't make financial sense for commercial egg laying flocks to have a rooster since they're usually all caged.
However, many homestead flocks, breeding flocks or commercial flocks that sell fertile eggs have roosters! And of course the roosters job is to fertilize said eggs.
Well, he actually fertilizes the hen and she stores the sperm in storage tubules until she needs it. One egg is produced by a hen per day, so she basically uses the sperm throughout the next few weeks.
When a rooster mates a hen, she can produce fertile eggs for up to 3 weeks later. So if you have a rooster with your hens, how do you know if her eggs are fertile or not? Well unfortunately no matter what anybody says online... and I've read some doozies... you cannot tell if an egg is fertile unless you crack it open, or attempt to incubate it.