For a specific answer, please provide more information, such as the program you were using. Off hand, though, I'd guess that the word processor recognized a common mistake (not leaving a space between two words) and corrected it automatically. Cleaning your keyboard wouldn't have any effect on you computer automatically adding a space.

Hope this helps,
John