A contract extension adds new years to a player's current deal before it expires, so they never reach free agency.
In HoopSim you can offer an extension during the regular season to any player in the last year of their deal. The new years start at the salary you agree, sit on top of the current season (which keeps its salary), and the whole deal runs at most five years, with 8% raises. The new salary has to fit inside your cap room or your Bird rights (Non-Bird up to 120% of their current salary, Early Bird up to 175%, Full Bird up to their max), never past the hard cap; a minimum deal is always allowed. Each player shows a stance, Eager, Open, Reluctant or Testing free agency, and you get a few rounds to agree. Young standouts on losing teams often want to test the market. AI teams extend under the same rules.
Rulebook: Re-signing. Related: Bird rights, max contract.