For nearly a century wheels were secured into bikes with a quick-release skewer. In combination with open dropouts, this system allowed for wheels to be changed on the fly without tools, and today the design is largely unchanged from the day it was invented.
First introduced on mountain bikes, thru-axles provide a stiffer and more secure dropout-to-wheel interface, ensuring the wheel is in the frame straight and removes the ‘have I done this uptight enough' uncertainty — it’s either screwed in all the way or it's not. All of this is key for running disc brakes, as too much flex in the wheel, or a wheel that is installed slightly off-centre, can cause the disc rotor to rub.
There was a lot of fluidity on standards and hub spacing when thru-axles first made the jump from mountain bikes, but the industry seems to have settled on 12x100mm for the front and 12x142mm for the rear. They are a bit more expensive to manufacture than QR dropouts, and at the entry-level price point, we do still see some gravel bikes using quick-release.