This holiday originated as a celebration and gathering before Lent, the traditional time of fasting for Christians. Karneval is a time to break rules and have fun before you give something up for the following 40 days. It's known as an opportunity to poke fun at people who normally make the rules. For example, the floats in the parade normally make fun of politicians and the decisions they make. People also give satirical speeches at the stage shows where they make fun of the people in charge. Being in costume is how people avoid(ed) getting in trouble.
You can find similar holidays to Karneval in most countries that have a large population of Christians. For example, Mardi Gras in France/New Orleans and Carnevale in Italy. While Karneval stems from Christian roots, not everyone that attends/celebrates Karneval has to be Christian. It has evolved into a community spectacle where most everyone gets involved in some way.