Melt the butter in a frying pan over medium heat. Add the onions, salt, pepper, onion powder, and cayenne. Cook, stirring often, for 5 minutes. Then, reduce the heat to medium-low and let the onions cook until they caramelize, stirring occasionally. You'll need at least 30-45 minutes for this, if not longer.