VTEC is the Honda version of variable valve timing and stands for Variable Timing and Electronic Control. These days, most auto manufacturers use some sort of variable valve timing to alter camshaft angle based on RPM, but VTEC, along with its corresponding valve timing, has long been a term with some level of notoriety for Honda.
One of the more unique aspects has been the implementation of multiple distinct camshaft profiles. This allows them to build one engine with multiple personalities. A more docile camshaft profile will typically offer a smoother idle and stronger torque at low speeds (low RPM) with better fuel economy. A more aggressive cam profile can improve cylinder filling at high RPM by keeping the valves open further and longer for maximum horsepower, but would typically offer a less than stellar idle and less torque at lower engine speeds. With VTEC, there is no need to choose between them. You can have both.
VTEC works through the use of a hydraulically actuated pin system of locking rocker arms together so that they can all ride on a common camshaft lobe when required (typically at higher RPM's). VTEC Solenoids control the oil pressure that is used to actuate the VTEC system, so this is all done automatically under the control of the engine management system and offers a near seamless change, though there may be an audible change when VTEC ‘kicks in’ at higher engine speed. There are versions that offer this function for both intake and exhaust valves, whereas others only offer it on the intake valves (SOHC VTEC).
Different variants have been used over the years for different purposes with some being more economy minded then others. Honda has been known to couple the VTEC system with their variable cylinder management (VCM), which effectively shuts off cylinders when they aren’t needed in order to improve fuel economy. There are also some direct injected variants which are specifically designed to be capable of running extremely lean for greatly improved fuel economy. In 2013, Honda introduced a series of VTEC turbo engines, most notable of which is probably that which is used in the current Civic Type-R. It is a turbocharged 2.0L 4 cylinder engine generating 306hp and 295 lb/ft.