I won't get too academic about it, so I'll give you the layman's summary.
And for the purpose of comparison, I'll emphasize the difference between Shotokan karate and Taekwondo, since Taekwondo derives from Shotokan directly. The differences increase greatly if you're talking about all of karate vs. Taekwondo. There are just too many branches of karate to really do that kind of a comparison well.
During the Japanese occupation of Korea (1910-1945), Koreans were forbidden to practice traditional Korean martial arts. The Japanese drafted young Korean men into the Japanese military. In Japan, these Korean soldiers - most of whom had no prior training in martial arts - would be exposed to Japanese martial arts such as Shotokan Karate, Daito Ryu Aikijujitsu, Judo, classical Jujitsu, and Kendo.
After the occupation ended, there was lingering resentment and anger towards the Japanese by the Koreans. They wanted to remove all aspects of Japanese culture from Korea and restore Korea's culture to the pre-occupation days.
The only problem was that 35 years was a long time. That meant 2 whole generations of people grew up in Korea never having been exposed to pre-occupation Korean culture. You can't bring something back if nobody remembers what that something was.
The martial arts, in particular, were suppressed to such a high degree in Korea that only a handful of older people carried on the traditions in secret. And they were old. Most who remembered it didn't really want to teach it or didn't feel they had sufficiently remembered it. Whole styles just vanished forever. Today, older Korean martial arts such as Taekkyon barely exist, and what is there is likely incomplete. Some of these styles were restored based only on photos, drawings, and oral history.
The Koreans were feeling understandably dejected. In order to restore pride to Korea, there was a push to come up with a national Korean martial art and sport that could rally everyone together. Without traditional Korean martial arts teachers to teach the new post-occupation Korea, the Korean martial artists that returned from Japan did what any good Korean would do: They Koreanized their Japanese martial arts and pretended or made it appear that they were Korean in origin. They simply couldn't call them Japanese martial arts, because the Koreans hated anything associated with the Japanese.
Taekwondo came from Shotokan karate and would become the national sport and martial art of Korea.
Hapkido came from Daito Ryu Aikijujitsu. Yudo came from Judo. Kumdo came from Kendo. These styles haven't achieved the popularity and significance that Taekwondo has for the Korean people.
Most schools of Taekwondo no longer practice the original Shotokan karate forms, although you can still find it in a few schools. ITF Taekwondo was the first federation of Taekwondo, and most of its forms were created by General Choi Hong Hi and contemporaries. These forms were the first generation of non-Japanese Taekwondo forms. They had names like "chon-ji", "dan-gun", "do-san", and so on.
These ITF forms were affectionately referred to as "blender forms", because they just took the original Shotokan karate kata, jumbled them up in a blender, and pulled out seemingly random moves to place in the new Taekwondo form. Actually, it was more complicated than that and definitely not random. But you get the idea. Typically, you might see 3 movements strung together in a Taekwondo form that came from a Shotokan karate form in the same order. So they weren't completely random, in other words. And probably the original authors of those Taekwondo forms thought those movements had some significance in order to keep them together like that.
Later, WTF Taekwondo would break off from ITF to form its own federation. And in doing so, they took those first generation ITF forms and attempted to Koreanize them even further. These second generation forms were named "taeguk 1", "taeguk 2", etc. These forms had higher kicks and more of them. In addition, the forms appear to have been constructed based on a cohesive philosophy separate from what they perceived as the original Shotokan karate philosophy. But that's a separate discussion.
And there have been many other Taekwondo federations and organizations breaking off from both ITF and WTF. Literally there have been thousands. These gave rise to the McDojo phenomenon of the 1980's. It seemed everyone was an 8th, 9th, or 10th degree black belt in their own style. Each one inventing their own forms.
Taekwondo comes directly from Shotokan karate. And Shotokan karate comes directly from Okinawan Shorin Ryu karate. Okinawan karate practices kata bunkai, which is a self-defense analysis for all of the kata in karate. In short, the karate kata encapsulate stand-up grappling based self-defense techniques for common everyday scenarios that are still applicable today. It's basically similar to classical jujitsu, with bone breaking added. The blocks in these forms aren't really blocks. You don't learn how to block by doing solo forms. You learn blocking from sparring. You learn self-defense grappling from kata.
Whereas, Shotokan karate does not practice bunkai, and so this self-defense meaning of the kata was not transmitted to Shotokan karate. And if it wasn't transmitted to Shotokan, it definitely wasn't transmitted to Taekwondo.
So the forms in Taekwondo (and to a large degree, Shotokan also) are basically meaningless. That allowed people to create new forms however they wanted. It's all pretty worthless as far as self-defense is concerned. But it is cool to practice for its own sake. It gives practitioners a challenge and a sense of growth when they learn and perfect new forms. In many ways, it's similar to contemporary wushu in that respect.
ITF and WTF Taekwondo differ in lots of other ways besides forms. In sparring, WTF has rules which forbid excessive force and punching to the face. People in WTF tournaments wear a lot more protective gear, too. Whereas in ITF, punching to the face is allowed, and harder contact is allowed. You can knock someone out in ITF, but it's not allowed in WTF. There's less protective gear in ITF.
There's much greater emphasis on defense in ITF than in WTF. In WTF, blocking is considered a waste of energy, which is why you often will see WTF fighters with their hands permanently down. In WTF, getting points wins, and you don't get points by blocking. So their strategy is to always be on the attack and be aggressive. In ITF, the motivation for blocking is to not get hurt (harder contact, and punches to the face are allowed). And so most people see ITF as more practical and realistic when compared with WTF.
Both ITF and WTF do continuous sparring, where nobody stops the fight when a point is scored. In addition to continuous sparring, there's also 3-point sparring, which is more popular in ITF schools. In 3-point sparring, the first one to reach 3 points wins. After scoring a point, the action is stopped and both players are centered up again. This 3-point sparring emphasizes defense, strategy (seeing patterns and predicting an opponent's next move), and split second timing / accuracy to a much greater degree than continuous sparring does. That's because you can only allow your opponent to hit you 3 times before you lose, so you have to play a more defensive game. And because the motion is stopped and players are returned to the center, it gives them the ability to focus and read their opponent. Whereas in continuous sparring, you can risk more to gain more points, and there is less time to think and focus on timing and strategy.
As for Shotokan karate, sparring is more like ITF Taekwondo's continuous sparring. There's less emphasis on protective gear. Punching and kicking to the face is allowed, although KO's and excessive force can cause disqualification in most cases. Shotokan also allows for punches to a downed opponent, something Taekwondo does not permit. And Shotokan allows for throws and sweeps, something that Taekwondo also does not permit. There's a lot greater emphasis on "cleaner" execution in order to get a point in Shotokan than in Taekwondo as well.
As for stances, Taekwondo in general has a much higher stance than Shotokan karate does. The center of gravity in a Taekwondo practitioner is much higher and tends to bob up and down. It's because it's much easier to perform high, snappy kicks that way. And you're more mobile with shorter, higher stances.
Whereas, in Shotokan karate, the center of gravity is low (at the hara / tanden / dantien), and stays there throughout. That is due in part to the greater emphasis on keeping balanced and preventing falls. Shotokan has deeper and longer stances than the Okinawan karate it came from. That's because of Shotokan's emphasis on physical fitness and away from practical self-defense. (Shotokan was brought to Japan by Gichin Funakoshi who adapted it for use in Japan's physical education programs for school children.)
Also, if you look at the level of the top of the head of a Taekwondo practitioner and trace it out, you'll see it goes up and down, especially for people doing ITF Taekwondo (which bases its movement on "sine wave" theory). Whereas in Shotokan, the head stays at the same level throughout. Power generation in Shotokan focuses more on the hips, rooted in a deep stance. Whereas, power generation in Taekwondo is more dynamic and depends on motion.
In terms of physical fitness, both Shotokan karate and Taekwondo will give you a good workout. But Taekwondo tends to be much more athletic. The emphasis in Taekwondo is on cardio stamina. There's a lot more movement in class. Whereas there is more emphasis in Shotokan karate on focus and meditation.
In terms of power, Taekwondo develops powerful kicks, but its punches are often much less developed. In Shotokan karate, it's the reverse: punching power is emphasized. Although, you could say that it's much more balanced for Shotokan karate than for Taekwondo.
There's a lot more to this topic, obviously. But I'll wrap it up here.
Hope that helps.