Here is what you must do to receive an egg:
Step 1# Gather two of the same Pokemon (Of the opposite Sex Of course)
Step 2# Go to the Day care on route 3 (in Black & white 2 you can only access that area after you've entered the hall of fame)
Step 3# Give your 2 Pokemon to the Day care Lady So she will take care of them while your out on your adventure
Step 4# Go out to her Husband to check to see If they are getting alone (If they aren't, you will have to start over)
Step 5# Depending on the type of Pokemon and how much they get alone, the More chance they will have an egg every Certain amount of steps (Depending on the type of Pokemon) So if you Have a Bicycle use it again continuously take the path in front of the day Care Until the Day Care Man calls you over (if you don't have a bicycle the next best thing to do would be running o the path)
Step 6# Go to the Day Care man to collect your egg (you can't have 6 Pokemon in your party otherwise he won't give the egg to you) (If you ask he will not know how it got there, So know one knows how they are made)
Step 7# Now simply wander around Unova until the egg hatches (or Go to Join Avenue and use a Nursery stall to help warm the egg (To be able to access someone who wants to open a Nursery, you must have entered the hall of fame and have the Avenues rank at level 15 or higher) (The time the egg takes to hatch will depend on the Type of Pokemon)
And there you have it, how Pokemon have a egg and how to hatch it (a little bonus from me)
Hope it Helps you! :)
(*Note, you can receive 4 medals from Mr. Medal for hatching eggs)