Surfaces on a two part mated assembly that is required to provide sealing must be designed so that the seal acts as a seal. While that sounds obvious, it seems to have escaped too many designers and designs which attempt to rely on properties of the jointing materials are too common. While such designs may work when new, "properties of the jointing material" is often time variant, and Murphy ensures that in most cases the variation is in an undesirable direction. (One exception, in many cases, are the "silicone rubbers". If these seal initially and use materials properly matched to the jointed materials, lifetimes of 20+ years are not uncommon.)
In the case of sealing against a pressure difference a simplistic perspective is that the force per area at the seal surfaces from the material in the pipe must be lower than the force per area exerted by all sources of sealing pressure. That sentence may sound strange but is written that way because there may be more than one source of sealing pressure.
The obvious source of sealing pressure is the bolts retaining the join.
An obvious way of ensuring that bolting "psi" (lbf/in^2, Pa, ...) is maximised is by minimising the area so there is "more pressure to go around" for a given bolting force.
Raised flanges allow formal sealing areas to be designed and area to be minimised.
Without such raised areas sealing psi is reduced.
Another less obvious and exceedingly useful means of exerting sealing pressure is to use the internal pressure to create its own sealing forces. This is the principle used by "O rings" which use pressure differential to deform a flexible ring in such a way that the sealing psi exceeds the leakage psi from the same pressure source. While O rings can be easily designed by following standard rules and tables, they in fact involve very black magic indeed, and numerous low cost designs that appear to employ O rings in fact just use squashed rings of flexible material. The difference between a true O ring seal and a bit of squashed rubber is proper design and manufacture and a relatively small extra $ outlay. The difference in performance is incomparable.