You provide your passport details to the airline when you depart the US. The airline transmits that information to the authorities before departure. (Occasionally, you hear about US Customs boarding a plane that is about to leave the US and detaining or arresting a passenger. This is how they know who is on board the plane.) Customs and Border Patrol details the I-94 process here: "I still have my I-94". The main way US Customs doesn't know you left is if you were issued a paper I-94 at a land border, didn't leave by a commercial carrier (ie drove or walked out of the US at a land border), and didn't surrender your I-94 when you left.
If you leave through a land border, there is a sign (at least at Canadian land borders) informing you that Canadian customs will transmit your passport information to US authorities to create a record of exit.
If you exit the country with a different passport than you entered on (eg you enter on a Canadian passport, which you might do because no ESTA is required, and leave on an Australian passport because you're traveling home to Australia and must use your Australian passport as the travel document for the flight to Australia), I don't know if the US will properly record that you left.
However, you are right that unlike many countries, the US does not have individual exit immigration checks. Canada and the UK are two other countries that do not have exit immigration checks. The US is definitely not as careful as Australia about recording entries and exits; they don't always know with certainty who has left the country, but they have a pretty good idea. Certainly millions of people overstay visas in the US. (The extent to which this is truly a problem is a separate political debate.)