Other contributors have said "How was karate created?" is the same question as "How was karate invented?" If you believe that these are not asking the same thing and should be answered differently, click here
Karate is a blend of White Crane style Kung fu and Okinawan wrestling (te). Legend says that Kung fu was created by the Bodhidharma in the Buddhist temples of China and that he was an Indian prince.
It began is a way of protecting one's self from thieves and bandits. It evolved to providing services to the King of the Ryu Kyu Islands for protection and police type services.
Legend has it that kung fu was developed by the Bodhidharma in China. Karate developed on Okinawa, combining Chinese White Crane Kung Fu with the local wrestling techniques.