A quick Google search reveals that the maximum resolution for VGA is 640x480. However, I'm currently using VGA at a resolution of 1366x768 and it's working fine.
How does this not malfunction?
"VGA" has two meanings:
A specific graphics card, the IBM Video Graphics Array from 1987, which supported resolutions up to 640×480 (now known as the "VGA" resolution), and which also introduced a new video connector type that's now known as the "VGA" connector.
The 15-pin analog video connector introduced by the IBM VGA but later used for 35 years by probably every other graphics card in the world.
So when people talk about the 640×480 limit, they refer to what the IBM "VGA" chip could output. The physical connection, however, can handle much higher resolutions, although it depends on the cable quality and shielding (at some point the analog signal begins to deteriorate).
(And the IBM VGA controller technically could generate video signal in higher resolutions, but mainly in text mode – e.g. the "80×25 characters" mode would generate a 720×400 pixel output.
Wikipedia also talks about it being possible to tweak the graphics mode to go as high as 768×576 if you didn't mind headache-inducing low refresh rates, but I don't think any OS offered such resolutions by default.)
VGA is an older signalling standard where a pixel is transmitted on only three pins by using analog voltages.
Each of these voltages is represented as a voltage level between 0 volts (no intensity) and 0.7 volts (full intensity). So a pure black pixel will have the signal level of 0v,0v,0v on the three lines, while a pure white pixel will have an ideal signal level of 0.7v,0.7v,0.7v on the three lines and so on.
This means that VGA is capable of transmitting in any resolution at all, one pixel at a time. Cable quality and transmission speed count strongly for the quality and responsiveness of the display.
From Wikipedia VGA connector - Cable quality:
The same VGA cable can be used with a variety of supported VGA resolutions, ranging from 320×400px @70 Hz, or 320×480px @60 Hz (12.6 MHz of signal bandwidth) to 1280×1024px (SXGA) @85 Hz (160 MHz) and up to 2048×1536px (QXGA) @85 Hz (388 MHz).
There are no standards defining the quality required for each resolution, but higher-quality cables typically contain coaxial wiring and insulation that make them thicker.
See How Many Dots Has It Got for what is today still called VGA, but has evolved far beyond 640x480. The resolution champion today seems to be WHUXGA (Wide Hex Ultra Extended Graphics Array) with resolution of 7680x4800 (36,864,000 total pixels).