This answers the question brought up here, which is similar but not identical to this question.
This comes down to how fast the keyboard can scan its keys.
Most less expensive keyboard designs will scan keys sequentially, from left to right and from top to bottom. This is cheap and easy to implement, but as you've observed, will tend to cause transposition of letters when typing at very high speeds.
Professional and gaming keyboards will generally scan faster than cheaper keyboards and are less likely to transpose letters in this fashion. In particular, while consumer-grade keyboards generally poll at only 125 Hz, which can easily cause problems when typing fast, gaming keyboards typically poll at 1000 Hz, which is much less likely to result in erroneous registration.
Furthermore, key switches (or any other electrical switches) are subject to bouncing, which means that when actuated, the switch needs some time to settle to a electrically stable state. As such, to avoid erroneous behavior, the keyboard electronics need to wait a bit when reading the state of the key. This delay is typically on the order of 20 ms. Mechanical key switches of the kind found in more expensive keyboards tend to need less time for this debouncing process than typical membrane key switches. In fact, keyboard and key switch manufacturer Cherry (whose MX switches are recognized as the gold standard for mechanical keyboards) has gone so far as to use analog readout of the key switches in the MX Board 6.0 to practically eliminate this debouncing delay and maximize responsiveness.