What is an ATMEGA328P

I'm about to start my first robot using Arduino, and I wonder what that long rectangular chip is. I later find out it is called the ATMEGA328P. What is it? Is it like a data storage for the code? If not, what does it do?

[original story: Let's Make Robots]