The absolute value of a number is the distance from 0. Distance is always positive, so the absolute value of a number is that number but positive. Thus, the absolute value of |2| is still 2. However, the opposite of a number is that number on the opposite side of 0. Therefore, the opposite of 2 is -2. To find the opposite of a number just flip the sign.
So, these are different because the absolute value is always positive while the opposite can be either sign.