The area of a military ship that caters for landing and taking off of aircraft is called the flight deck. Flight decks have been in use by the military since 1910, with the first pilot to take off from a warship being Eugene Ely.
These early ships were usually repurposed ocean liners that had a flight deck crafted out of wood. It ran over the longest part of the uppermost deck to provide enough landing and taking off distance.
This same principle was inherited later by purpose-built military aircraft carriers in the 1930s.
By the 1950s, as military fighter jets got far more advanced and fast, new and innovative ways to stop these jets needed to be implemented. This was because if a pilot were to miss the arrestor cables, they would risk damaging the fleet of parked aircraft at the end of the runway.
A simple solution to this was proposed; angling the runway a few degrees off from the centre of the ship's hull. Then, if a pilot missed the arrestor cables on deck, he could simply increase thrust and take off again. This mitigated the risk of potentially damaging stowed aircraft on the deck.
Check out the video below by the YouTube channel, Military TV, on Why Aircraft Carriers Have An Angled Runway...