How does Wikipedia's simplified to traditional converter work?
The Mediawiki converter uses a combination of automatic information from the Unicode standard, SCIM tables, and other sources plus manual tweaks to build a set of translation tables.  When going from Traditional to Simplified, some characters have been condensed into one.  Translating back from Simplified to Traditional requires context that a computer is not likely to understand unless you implement a full translation engine, not just a text replacement engine. This is where the manual enhancements come into play.  

Mediawiki has a build system which automatically combines the automatic and manual information into a PHP source file of translations between many different types of Chinese.  It appears to cover dialectical differences for mainland Chinese, Hong Kong, Taiwan, and Singapore. The information is then changed out with PHP's strtr() function which replaces all occurrences of items in a given array with matches in the supplied string, longest matches first.  This longest matching is the key when switching out characters because you have more context from the source to make a better replacement. 

Source:
Code which uses mediawiki's conversion functions:
https://github.com/tszming/mediawiki-zhconverter/blob/master/mediawiki-zhconverter.inc.php

Build file to combine automatic conversion tables with manual tweaks:
https://phabricator.wikimedia.org/diffusion/MW/browse/master/maintenance/language/zhtable/Makefile.py

Compiled translation tables (large file, 17k lines):
https://phabricator.wikimedia.org/diffusion/MW/browse/master/includes/ZhConversion.php

Conversion tool to load tables for different conversions (used by first source link)
https://phabricator.wikimedia.org/diffusion/MW/browse/master/languages/classes/LanguageZh.php