Three factors come into play with recoil - charge weight, gun weight, and gas direction. First, charge weight: this is the load of powder in your particular cartridge. If you took high school physics, and remember anything, you should remember Newton’s laws. In specific, we need to talk about two of them, the second and the third.
The second law is that force is mass times acceleration. This is the law that dictates how much force a projectile is putting out and how much is needed to send it at the desired acceleration. In a firearm, this force comes from the chemical reaction of the powder igniting. This ignition sends gasses and pressure in a direction, specifically down the barrel. This comes to Newton’s third law, for every action there is an equal but opposite reaction. This is the basis for recoil. Simple math tells you the larger the projectile or the faster you want to throw it, the more force you need, so the larger the charge. This is why a bigger bullet means generally, more recoil.
So why does gun weight matter? Well, depending on how your system is set up, it might transfer energy from the expended projectile into cycling the gun itself, or siphon off the gases produced to do the same thing. This involves moving parts, but the bigger movement is well, the equal but opposite reaction. This is where inertia and the second law again comes into play. The more mass you have, the harder it is to move. Weight is a pretty good correlation to mass. The heavier your gun, the less recoil force you feel, as more energy is needed to propel it back than is produced.
We go back to the third law for our last bit. As the projectile leaves the barrel, the gasses go out of the end, exerting force on you. The shorter the travel time down the barrel, the more force these gases have. Every action has an equal and opposite reaction, so as they go straight out, the forces also go straight back. The muzzle break directs some of the gasses away from that straight out path, thus reducing that source of force and with it, recoil.
This is pretty basic and doesn’t get into other math, and I might have gotten a bit wrong, but this should explain how recoil actually works and why muzzle breaks are still going to be a reduction to it.