What is the keyup function meant to do?
When you press a key on your keyboard, it goes down, then up. The
keydown() event listener will trigger if you only press the key down, but the
keyup() listener triggers when the key is let up. There's also
keypress(), which is similar to
How does it amend the meme generator?
Every time you let a key up, it runs the code inside the event listener. It only does what you tell it to, and you're telling it to replace the text with some new text.
Why would it be needed?
Without listening for a keypress of some sort, you won't know when to update the text.