Using a 10" cast iron skillet, melt the butter. Saute the onions until softened. Turn off heat and spread onions evenly in the pan.
In a large bowl, combine cornmeal, pepper, baking powder, sugar and salt.
In a small bowl, whisk together the milk, sour cream and eggs. Whisk well until thoroughly combined. Add to flour mixture and mix until thoroughly combined.
Fold in the cheese and corn. Add this batter on top of onions in skillet. Spread in an even layer.