Flange gaskets are used to create a static seal between two flanges faces, at various operating conditions, with varied pressure and temperature ratings. A gaskets fills the microscopic spaces and irregularities of the flange faces, and then it forms a seal that is designed to keep liquids and gases. correct installation of damage-free gaskets and demage-free flange faces is a requirement for a leak-free flange connection.
if it would be technically possible, in order to manufacture flanges perfectly flat and smooth, and perfectly compatible with one another under all operating conditions, a gasket would not be necessary. but in normal practice it is not possible, because flange connections under any circumstances should be made. small impurities and a small bit of dirt, is in practice not be avoided and therefore it is necessary to use a gasket.