It's used to prevent anything coming back up the hole.
Drilling fluids, the circulating fluid for drilling operations,
is a mixture of the fluid, the solid and chemical agents. It is
usually known as the "mud" or the "blood of drilling" deriving from
its distinctive significance.
The main functions of drilling fluids include providing
hydrostatic pressure to prevent formation fluids from entering into
the well bore, keeping the drill bit cool and clean during
drilling, carrying out drill cuttings, and suspending the drill
cuttings while drilling is paused and when the drilling assembly is
brought in and out of the hole. The drilling fluid used for a
particular job is selected to avoid formation damage and to limit
corrosion.