Raycasting is one of the simplest techniques to render a 3D looking scene, it's not actual 3D...
It is based on perspective, where the size of an object on the screen is inversely proportional to its distance to the camera.
Video tutorial: https://youtu.be/4gqPv7A_YRY