In modern science fiction, especially popular entertainment, computer and video games, and other soft scifi, shields are a form of armor for starships and other self-powered and important objects or facilities. They usually involve a bubble of translucent or transparent energy around said object or ship that repels/absorbs/drops into another dimension incoming enemy attacks, or other things that can cause damage to things under the shield.
Shields come in a variety of flavors throughout scifi. In Star Wars they are powerful layers of invisible energy that are used to absorb the Multi-Gigaton level blasts fired from Heavy Turbo Lasers mounted on large capital ships. Another quite different instance are the sidewalls on capital class ships in the Honor Harrington book series, which repel physical attacks using large-scale gravity manipulating fields which are also used in engines. A third still striking example is in the Dune series of books, where shields are small enough to be fitted personally and capable of breaking the conservation of momentum and causing fusion explosions when they come into contact with weaponized laser beams. In Dune shields force people back to close range combat, to pierce the shields with slow moving objects.
The range seen here is evident of their purpose in science fiction. They answer the question of how do you keep the nuclear death rays from killing everyone on the heroic space rocket. They provide a plot point that changes the way combat must be executed in instances such as Honor Harrington or Independence War or Dune. They balance opposing forces in other instances to allow the ships and other facilities to absorb the enormous weapon yields of enemies, while at the same time allowing for incredibly destructive weapon systems, such as those in Star Wars or Star Trek.
Scifi in general is meant to allow for the re-use ideas and stories from classic works and bringing them to a limitless frontier. Shield technology is one of the bridges to bring classics into new worlds; Horatio Hornblower can't say "shields up, all ahead full" but Captain Harrington can.
Shield technology can be the way a science fiction book proclaims its alienation from what we understand to be possible. A bubble of translucent technological blue that protects our heroes from searing painful or nigh instantaneous death. It is a device of the plot that allows for a change in the way people and ships interact and add rules to the way combat occurs in the story.