Lava is a hazard that appears in many Mario games. It mainly serves has a hazard where if Mario touches one, he instanly dies though this effect is different in games like Super Mario 64 and Super Mario Sunshine. Lava is usually home to Podoboos and is Bowser's main hazard he has in his castles.
Lava appears as a harzard in Super Mario Bros., Super Mario Bros. 2, and Super Mario Bros. 3. Lava mainly appears in Castle levels where if Mario falls into it, he instanly dies. In Super Mario Bros, this is a classic way of finishing off Bowser at the end of levels. Podooboos also tend to jump out of lava in these games.
Lava appears in many levels in this game where it's purpose is the same as in the Super Mario Bros. games. The first castle in this game is known for using lava to defeat Iggy Koopa. If Mario lands in lava, even if he has a Cape, he instanly dies. Enemies known as Blarggs tend to lurk around in the lava.
Lava appears mainly on Lethal Lava Land and in Bowser in the Fire Sea in this game. This game is known for the lava not defeating any of the characters on contact; rather burn them multiple times for damage until they finds a safe platform to land on. Lava is also used to defeat Bullies.
Lava is a hazard in some courses in the Mario Kart game. Whenever a racer lands in lava, they lose all their items and Lakitu carries them out. Also not as bad as the chilling water, lava can greatly send a racer back a few places. Lava always appear in Bowser's Castle related courses.
Lava minorly appears in the Paper Mario games. Much like from Super Mario World, if Mario lands in the lava, he bounces back out only taken one point of damage. Mario's partner Lakilester is the only one who can carry Mario safely across lava without harm along with Carrie.
Lava once again appears as a one-hit kill in the New Super Mario Bros. games. Lava is also used to finish off Bowser which, in turn, turns him into Dry Bowser. Lava also mainly appears in castle levels where Mario usually uses it to finish off Bowser Jr. or The Koopalings.
Lava is usually used as a hazard to elimate players in the Mario Party games. In Mario Party 7, there is a Bowser event where Lava rises up in a certain area and the player that was on the platform loses all of their Stars.
In those games, lava kills the player instantly, like in 2D Mario games.