Most journals are now owned by one of the big three for-profits (Springer, Wiley, and Elsevier).
There are other journals that are owned by non-profits like the American association for the advancement of science (AAAS owns Science) or specific scientific societies. The American Physical Society publishes all the Physical Review journals. The American Institute of Physics does Applied Physics Letters, Journal of Applied Physics, Review of Scientific Instruments, and many others.
A few are owned by large funding bodies that are pushing some desired change to publishing (like HHMI which owns eLife). Things like arXiv are generally managed by academic institutes and funded by private money (the Simons Foundation and CZI are both big funders).
The high profitability of academic journals means that the for-profits are really squeezing the society journals, but AAAS and eLife are still doing fine.
There are some differences by field, but this applies to most STEM fields.