He saw soldiers eating chocolate pellets with hard chocolate shells . He decided to make his own chocolate candies . Forrest Mars , Sr. , the founder of the Mars Company , got the idea for the confection in the 1930s during the Spanish Civil War when he saw soldiers eating chocolate pellets with a hard shell of tempered chocolate surrounding the inside , preventing the candies from melting .