Metamagic is very much a D&D thing - and it was a D&D thing long before it was ever a pathfinder thing ^.^

In 5e, it's available to sorcerers as one of their core class features, and also in a more minor way to others by way of a feat.

Originally Posted by PHB, Classes, Sorcerer
Metamagic

At 3rd level, you gain the ability to twist your spells to suit your needs. You gain two of the following Metamagic options of your choice. You gain another one at 10th and 17th level.

You can use only one Metamagic option on a spell when you cast it, unless otherwise noted.

Careful Spell

When you cast a spell that forces other creatures to make a saving throw, you can protect some of those creatures from the spell’s full force. To do so, you spend 1 sorcery point and choose a number of those creatures up to your Charisma modifier (minimum of one creature). A chosen creature automatically succeeds on its saving throw against the spell.

Distant Spell

When you cast a spell that has a range of 5 feet or greater, you can spend 1 sorcery point to double the range of the spell.

When you cast a spell that has a range of touch, you can spend 1 sorcery point to make the range of the spell 30 feet.

Empowered Spell

When you roll damage for a spell, you can spend 1 sorcery point to reroll a number of the damage dice up to your Charisma modifier (minimum of one). You must use the new rolls.

You can use Empowered Spell even if you have already used a different Metamagic option during the casting of the spell.

Extended Spell

When you cast a spell that has a duration of 1 minute or longer, you can spend 1 sorcery point to double its duration, to a maximum duration of 24 hours.

Heightened Spell

When you cast a spell that forces a creature to make a saving throw to resist its effects, you can spend 3 sorcery points to give one target of the spell disadvantage on its first saving throw made against the spell.

Quickened Spell

When you cast a spell that has a casting time of 1 action, you can spend 2 sorcery points to change the casting time to 1 bonus action for this casting.

Subtle Spell

When you cast a spell, you can spend 1 sorcery point to cast it without any somatic or verbal components.

Twinned Spell

When you cast a spell that targets only one creature and doesn’t have a range of self, you can spend a number of sorcery points equal to the spell’s level to target a second creature in range with the same spell (1 sorcery point if the spell is a cantrip).

In later books, further Metamagics were added:

Quote
Seeking Spell

If you make an attack roll for a spell and miss, you can spend 2 sorcery points to reroll the d20, and you must use the new roll.
You can use Seeking Spell even if you have already used a different Metamagic option during the casting of the spell.

Transmuted Spell

When you cast a spell that deals a type of damage from the following list, you can spend 1 sorcery point to change that damage type to one of the other listed types: acid, cold, fire, lightning, poison, thunder.

The resource Sorcerers spend to use their Metamagic is Sorcery Points, of which a Sorcerer has a number equal to their sorcerer level, which recharge by long rest. They can also trade sorcery points for spell slots and vice-versa, as part of their flexible casting feature, but this is at a heavy loss rate - you gain sorcery points equal to the level of the spell slot you convert, but it costs more to make spell slots back with them (2 for a 1st, 3 for a 2nd, 5 for a 3rd, 6 for a 4th and 7 for a 5th; you cannot make spells lots higher than 5th)