The first video games ever created date back to World War II, and were used to aid the Allies against the Axis Powers. After the war, the promotion of the first stored program architechtures in several universities allowed computers to be reprogrammed to do a multitude of tasks, which lead to the commercialization of computers in the 1950s. This caused universities, large companies, and even government organizations to start using computers, which would become the birthplace of video games.
The earliest known video game is a chess simulation called Turochamp. It was completed in 1948 but never actually installed into a computer. The earliest known video games that were installed into a computer were a game of tic-tac-toe and a game called Nim, which were displayed in 1950 and 1951, respectively.
Around the time the three "games" mentioned above were created, video games were as instructional, research, or demonstrational programs. the first video game to be created purely to entertain was called Tennis for Two, created in 1958. But due to the limitations of the hardware, commercial video games wouldn't come until the '70s, when Medium Scale Integration (MSI) and transistor-transistor logic (TTL) circuits were created. These, along with other advancements during the '60s, lowered the price of computers enough that it became of consideration by the coin-operated games industry.
This is a simplified version of a type of popular arcade game at the time, the Snake games.
And thus, the early arcade game generation, and the main life of video games, began.
Mainframe computer games were created in 1971, and arcade games and the first generation of home consoles were created in 1972. The "golden age" of arcade games was from 1978-1982, the second generation of home consoles and early home computer games being created at the same time.
Leading up to 1983, the gaming market became filled with poorly-made games, important Atari 2600 games failed, and home computers made consoles unpopular and obsolete. These three, mainly, lead to the video game crash of 1983, causing thousands of Atari titles to be buried, and companies like Nintendo and Sega to be on the rise, leading to the creation of the Nintendo Entertainment System (NES). This system, along with the Sega Mark III, revived the video game industry, the NES being one of the forefronts of the third generation (8-bit generation) of home consoles, so much so that the generation ended at the console's discontinuation at 1995.
The 4th generation of consoles (16-bit generation) lasted from 1987-2003, one of the front runners of this generation being Nintendo's Super Nintendo Entertainment System (SNES). During this time, arcades started to lose popularity, basically dying out around 1999 as the industry began to transition to 3D, and handheld and PC gaming started to become popular.
The 5th generation of consoles (32 and 64-bit) existed from 1993-2005, some front runner consoles being Sony's PlayStation 1 and the Nintendo 64 (N64). During this generation of consoles, the industry began transitioning to 3D fully, using CDs, and Mobile gaming was created.
The 6th generation of consoles lasted from 1998-2013, some front runners of this generation being the Sega Dreamcast, the Nintendo Gamecube, Sony's PlayStation 2, and Microsoft's debut into the gaming industry, the original XBox. During this generation, Online and Mobile gaming really began to catch on.
During the 7th generation of consoles, which lasted from 2005-2012, the Nintendo Wii, Microsoft XBox 360, and Sony's PlayStation 3 were popular consoles, and the Nintendo DS and PlayStation Portable (PSP) were popular handheld systems at the time. Casual gaming and Cloud computing was on the rise during this time, and the rise in the Wii's popularity began a trend of motion control.
And lastly, the 8th and current generation of consoles started in 2012, with the XBox One (not to be confused with the original XBox), PlayStation 4, and Wii U being the forefront consoles, and the Nintendo 3DS and PSVita being the forefront handhelds of the current generation (as of now). The main technological advancement of this generation (again, as of now) is Virtual Reality (VR) systems: head-mounted displays that track motion to make users feel as if they're "in the game".