A filter is inserted in the path of the x-ray beam to

absorb backscatter radiation

absorb long wave length radiation in the primary beam.

limit the area of surface exposure

absorb stray radiation

make it possible to use higher kilovoltage for improving image quality