A demo is a client- or serverside recorded replay. Demos are used in competitive play to prove the correctness of a played match and for creating fragmovies. Since demo files are really small, it's easy to share whole matches with other people which would be huge files when saved to an actual video format.
To record a demo you need to type g_synchronousclients 1, record nameofthedemo (or just record which will generate files with continuing numbers) and after that g_synchronousclients 0 into the console. Some mods allow recording demos without having to use the g_synchonousclients command.
You can watch demos by either opening the demo menu or by typing in 'demo [nameofthedemo]' into the console (without the ). The demos need to be in the base/demos folder to get recognized by the game.
Jedi Academy on version 1.0 reads .dm_25 files while the update 1.01 uses .dm_26 files. Jedi Outcast uses .dm_15 (on version 1.02 and 1.03) and .dm_16 files.
The term 'demo' may also refer to a freely distributed piece of an upcoming or recently released video game. Demos are typically released by the game's publisher to help consumers get a feel of the game before deciding whether to buy the full version.