Uhh. Well, first, martial arts is the term for any cultural style of fighting, like karate, kung fu, tae kwon do, Brazilian jiu jitsu, krav maga, aikido, etc… they come from all over the world and have different histories and often really interesting origin stories. A martial art can revolve around join manipulation and technique, like aikido or judo, ground fighting like Brazilian jiu jitsu or wrestling, fighting while using weapons, like archery and kendo, or involve striking with your hands, feet, elbows, and knees, like karate, muay Thai, boxing, tkd, krav maga, wing chun, and many others.
Now the basic/main differences between karate and kung fu are geographical and historical. Karate originated in Okinawa, an island near Japan, which has been under the influence of both Japan and China over the years, but karate was developed while the Chinese were in charge (fun fact, but I’m not 100% sure if this is true, is that the Okinawan farmers were not allowed to have weapons during this period, and so developed ways to use farming tools offensively. Because, who can tell a farmer to stop using his scythe that he needs to cut grain?), and so is based off of Chinese styles, but was later brought to mainland Japan in the early 1900s, where some say it was “refined.” Kung Fu, being the general term for Chinese martial arts, has therefore existed for much much longer than karate. I think the most influential style of kung fu for karate is called White Crane (again, I’m not exactly a history buff when it comes to this stuff). Wing chun and wushu are types of kung fu, as is the ideology of the five animals. Think Kung Fu Panda, the animals are tiger, mantis, crane, monkey, and snake, and are utilized to display the variability of fighting styles as well as the ways of life a martial artist can lead.
Tl;dr: Martial arts is the umbrella term, “kung fu” just means any and all martial arts from China, while karate is a distinct (although incredibly expansive) martial art, which has been influenced greatly by kung fu styles.
Hope that helped :)