The "2Pac hologram" was created using the trick Pepper's Ghost, first demonstrated by its inventor, John Henry Pepper, in 1862.
The trick involves an angled pane of glass used to reflect an image of a person hidden off stage, making it appear that the translucent image of a person had appeared from nowhere.