A typical way of doing things in a GUI program is to handle "events". The framework arranges for event delivery. The event has properties s.a. what UI element registered it and the sort of mouse action performed, and the handler code specializes on that combination to take the (hopefully) intended action.
When it comes to testing, in order to emulate such events, one would have to calculate the location of the element that "registered" the desired event in order to trigger the desired functionality. This is usually very hard to do because elements change their positions on screen, it can depend on screen resolution, display style of scrollbars and so on.
Another problem with the event-driven model is that it's typically asynchronous. The automation code has no good way of telling when the action associated with the even should take place, or, rather, when it should finish taking place, to assess the results.
Typically, programs controlled through keyboard expose functions associated with desired functionality (because they need to bind something to the key). The test automation then can call these functions instead of emulating events. The detection of the moment when the action finished execution thus becomes trivial.