Federal immunity refers to the legal doctrine that protects the federal government and its officials from being sued without their consent. This principle is rooted in the idea of sovereign immunity, which maintains that the government cannot be taken to court without its permission, ensuring that it can function effectively without the fear of constant litigation.