Subprime mortgages were those that stood to default almost immediately. Prime mortgages were those that were more likely to default later. The main difference was timing.
Subprime mortgages were those taken out by people who were certiably unable to pay. They had blemishes on their credit records, because they had overextended themselves in the past. That's why they were "subrprime," and higher risk.
Prime mortgages were those made to people who had good past payment records and appeared to be able to pay. Until they lost their jobs. Or had unexpected medical bills. Or until housing values went down, rather than up.
The culprit was the pedal to the metal economy of the past two decades. People used to pay no more than three times annual income for homes. Then the ratio rose to four, five, six times. they're incomes were stretched to the utmost. That's why they couldn't pay if ANYTHING went "south," even though they had paid in the past.
Many homeowners were loaded down with other forms of debt, such as student loan or credit card debt. They bought houses with the intention of taking out home equity loans to pay down their other debts. In essence, they were operating a legalized check kiting scheme.
But the game came crashing to a halt when uenemployment rates went up and housing prices came down. That's why many formerly "prime" loans and borrowers are now effectively "subprime."