Thunderstorms can be triggered by a variety of factors: first, fronts; then an outflow boundary, which is a push of wind out ahead of a main line of storms; and lastly, popcorn or pulse thunderstorms that appear almost out of nowhere.
Front-driven storms form along a dividing line between humid warm air out ahead of a line of storms and cooler, drier air behind it. That contrast is exactly why thunderstorms develop.
The second type is a gust front—an area of wind out ahead of the main line of storms that can trigger additional thunderstorms. Sometimes these storms also become severe.
The third type is the most difficult for a meteorologist to forecast. "Popcorn" storms, like popcorn popping in a microwave, are hard to predict which one will pop first. They are often very tiny, sometimes five miles in diameter, where one neighborhood is sunny and another gets a downpour.