The pilgrimage to Mecca is one of the Five Pillars of Islam. Every Muslim who is able to both physically and financially must make the pilgrimage at least once in their life.
The purpose of the pilgrimage is to visit holy sites in and around Mecca and to reenact certain important scenes from Muslim history. For example, all pilgrims symbolically throw stones at pillars that represent the devil. When they do this, they imitate Abraham who threw stones at the devil when the devil tempted him. By doing these things, the pilgrims show their unity with all Muslims. They also try to cleanse themselves of their sins and to glorify God.