If the egg remains unfertilized, the egg dissolves
and your body then sheds the tissue in the form of
bleeding. If the egg IS fertilized, it will then start to divide and after 7-14 days will implant into this lining. If you shed this lining while pregnant, the egg (which is attached) will then be flushed out with the rest. So if a female has a TRUE period while pregnant, she will miscarry.
Now, it IS possible to just bleed while pregnant.