R2-D2 is an astromech droid designed to help in space travel and mechanics. He is a small, blue, domed droid who everyone loves, even the baddies. No-one would dare shoot him, and those who do shoot themselves. He is sarcastic, witty and resourceful which is why all the idiots who own him end up surviving. He has kept C-3PO safe this whole time, so why wouldn't he help the odd Jedi?
He originally served on a Naboo ship and proved his prowess when he dodged the blaster bolts and repaired the shield generator mid-flight, saving everyone aboard including the Queen when they were under attack by CIS. He served in the war between the Republic and the CIS and lived to see its outcome.
He also served in the Rebel Alliance, and belonged to Luke Skywalker. He brought the Death Star plans to Obi-Wan Kenobi and helped destroy the Death Star by coming aboard Luke's X-Wing fighter to perform repairs.
He assists the Rebels in taking down the Empire, by performing maintenance on ships and using his resourcefulness to hack computers, open doors and disable security systems. He also helped during the final battle on Endor by disabling the security systems to the shield generator of the Death Star II, ultimately leading to its destruction.
He is considered the hero of the Galactic Civil War, since he did pretty much everything.