The Formula 1 brand and commercial rights are owned by Formula One Group, a full owned subsidiary of Liberty Media and represented by Stefano Domenicali.
Profits generated by running the event are divided between the shareholders of Formula One Group and the teams. The latter being a points weighted prize system.
Of course the exact structure of the companies and their various shareholdings is more complicated than this, but for the average armchair fan, this is the basic structure.