Filters do lots of different things depending on what filter it is.
The plastic bits are lens hoods. They prevent extraneous light from entering the lens and creating flare in your images. They also do a good job of protecting the front element from grubby fingers and unwanted knocks.
I just use hoods on all my lenses. They make better images and protect the lens well. Filters I use as and when required, such as a polariser or neutral density filters. (A quick search will throw up descriptions and example photos). The only other occasional protection I use is a plastic bag with a hole in it, if I'm heading out in a storm.