The average academic journal has 25%-30% profit margin (higher than the rest of the publishing industry), but it can take upto 5-7 years for a new STM journal to build enough of a reputation to break even. The profits from the successful journals have to cover the failure of the others (not unlike the startup industry from an investor perspective).
If you look at an open access journal like PLOS Biology the fundamental economics aren't that different. PLOS Biology charges authors $2900/paper, at about 20 papers an issue that means an issue generates just under $60,000 in revenue (excluding revenue from print sales). Overall PLOS runs at a 20% profit rate but it's not significantly different from other mid-tier closed-access journal publishers.