Given the immense amount of time during which evolutionary development has taken place, any number of alternatives could have developed. So the current system of mammalian reproduction is the result of innumerable steps in variation. Bear in mind that mammalian reproduction is only one fraction of all the reproductive systems present in terrestrial organisms. Most organisms don't have a liver but the tetrapods they're descended from had already inherited a digestive system from much earlier organisms. None of how we are now was inevitable - we're just a very very long-term example of how choices made at one point in time affect the future.