This link gives a pretty good summary of the basics.
https://www.lightmanimmigration.com/tn-visa-or-h-1b-visa/
If you google, there are many others.
To add,
1. H1B is extremely expensive for the employer. For a large organization, it might cost 10k-20k to obtain a new H1B and probably 10-15k for renewals depending on a lot of factors. It's also not uncommon for them to spend a lot of money and then realize all the effort was a huge waste.
2. It's onerous for the employer to keep up with all the H1 requirements. For example, during the pandemic, if you are someone with a US employment authorization or a TN, you could have moved to a different state when employers implemented work from home policies but as a H1 employee you cannot move to a new location (you can move within the same metro statistical area) without a new set of paperwork. There are also a lot of additional burdens when the employer has more than 50% of their employees on H1B. TN is much more flexible. For example, it doesn't need a new petition if you're just changing locations with the same employer.
3. H1-B is a dual intent visa which means at the time of applying, you do not need to prove to anyone you're asking only for a temporary worker status and not intending to file for a permanent resident status in future. As a non-immigrant, you can leave the country after 6 years of entering oe whenever your status ends. Or, if you find a willing employer, they might offer you a chance to apply for permanent residency through employment. With H1-B, your employer can start processing your green card application on your start date (typically doesn't happen, but it's legal). There are some ways to apply for an immigrant (green card) petition while on TN but your renewals might become complicated if you also have a green card petition underway in parallel so there are a lot of intricacies. Most employers typically first convert the TN employee to a H1 before starting their green card process. Despite all the costs, if an employer is looking to hire and keep you long term, they'll opt for H1 either right away or eventually (after you join them using a TN or as a student under the OPT program).
4. H1 initial and renewal petitions can be done only via a US CIS petition (Form I-129) and then carrying the approval notice at the entry (for the initial petition). CBP cannot approve your H1B petition without a prior US CIS approval notice. TN initial and renewal applications can be approved directly by the CBP at the port of entry or alternatively, by the US CIS (I-129). If you prefer, you can stay in the US and your employer can file the renewal eliminating the need for you to travel to a port of entry and the associated uncertainties.
Say, if you have any prior US immigration violation such as overstaying in a visitor status, you can have much more certainty by going through the USCIS route even for TN, getting an approval notice first, then using that at the port of entry. Otherwise most folks just drive to the border with their employer letter and documentation for on-the-spot adjudication.
5. Getting the H1 status for the first time is an extremely competitive endeavor. Your odds are typically 1:2 or worse although recent changes have made it a little easier to retry with much lesser cost than the previous years but you still need a willing employer. TN has no annual cap and the initial status can be obtained any day of the year (unlike H1 which is usually once a year at the start of the US CIS calendar, in recent years you can apply only once in April and the employment can begin no earlier than October).
6. Before an employer can file a H1B application, they need to file a Labor Condition Application (LCA) with the Labor Department proving the wage is at equal or greater than the published equivalent wage for someone in the same geography doing similar work. TN on the other hand does not have any LCA requirements (your employer will still need to pay at least the wages in the employment contract). Therefore, especially in recent years, H1 salaries are typically higher than typical TN salaries in most geographies.