For the US citizens, the airlines allow submitting the passport information through their apps (United) or self-serve kiosks (Delta), at least based on my personal experience, and in-person check in is not required. The security check before the boarding gates is still required for everyone though (for US citizens they check that you have the passport there, but I'm not sure if all the airlines do that - I've only experienced it with United).
For green card holders and other non-US people, the airlines are required to verify that you have the necessary documentation when you board. US citizens cannot be deported, everyone else (including LPRs) can be denied entry and flown back at the airlines' expense if they lack proper documentation. The only way to verify that they do in fact have that documentation is to physically inspect it at the airport (including prior to boarding, but it's cheaper and more efficient to do it at check-in since the facilities are all there already).
I had similar experience with other countries as well. For example, I needed to go through documents check on my flights to China (visa required) before boarding. I believe they also forced me to check in in person then. On the way out of China the Chinese immigration authorities perform the check. You can't leave the country if you don't have entrance visa/permit to your destination.