In normal terms, they both refer to member object but the survival or existence of the member object without the containing class or object or after the lifetime of the containing class or object makes the difference. Aggregation is also known as a 'has a' relationship because the containing object has a member object and the member object can survive or exist without the enclosing or containing class or can have a meaning after the lifetime of the enclosing object also.
Example ('has a'): Room has a table and the table can exist without the room. The table can have meaning without the room also.
Composition is also known as a 'is a part of' or 'is a' relationship because the member object is a part of the containing class and the member object cannot survive or exist outside the enclosing or containing class or doesnt have a meaning after the lifetime of the enclosing object. Composition is used over inheritance when different roles are to be played by a single entity. The 'is a' relation comes in this case.
Example 1 ('is a part of'): Computer Science Department is a part of the College. The Computer Science Department cannot exist without the college and the department has no meaning after the lifetime of the college.
Example 2 ('is a'): A Person is a supervisor. A Person is a husband. Supervisor and husband are the roles played by a single person. The husband role without the person has no meaning or cannot exist and similarly for the supervisor also.
From the above figure, Battery and Smart Phone explain Aggregation while the other relations explain Composition. The Smart Phone has a Battery. The Battery can exist without the Smart Phone and it has a meaning without the Smart Phone. On the other hand, the IMEI Number is a part of the Smart Phone and the existence of the IMEI number completely depends on the existence of the Smart Phone. The IMEI Number has no meaning without the Smart Phone. While the relation between IMEI Number and the Smart Phone explains the 'is a part of' type of composition, the other relation explains the 'is a' type of composition. The Smart Phone, in this case, plays roles at different times. The Smart Phone is a Camera. The Smart Phone is a Web Browser. The Smart Phone is a Music Player. The Music Player role of the Smart Phone cannot exist when the Smart Phone itself is not available.
Thus, Aggregation and Composition are almost the same conceptually but differ in implementation because, the contained or member object should be deleted in case of composition while the member object should not be deleted in case of aggregation.