It can act like keyboard an mouse that are valid input devices on phones too. With control of user input badusb device can download and install malware on the phone.
Which keystrokes are you talking about and on which OS does that attack work? I can't think of anything that would work on my iPhone.