In addition to the other good answers, keep in mind that the piano has a sustain pedal.
On guitar, sustaining a note requiresrequires* keeping your fingering*; sofingering. So, adding a riff requires having available fingers that aren't being used for the chord.
However, piano frequently takes advantage of the sustain pedal, allowing you to use up to all 10 fingers to add a riff to a chord, and the original notes can still be sounding. Going further, you could have dozens of notes involved in a single chord by keeping the sustain pedal down and making your way across the keyboard.
I would recommend learning piano fingering as they are traditionally taught.
*As Tim noted in the comments, there are ways to sustain notes on guitar that don't involve keeping your fingering. Certain pedals, harmonics, and other devices/techniques allow for riffs to be played along with a chord. *As Tim noted in the comments, there are ways to sustain notes on guitar that don't involve keeping your fingering. Certain pedals, harmonics, and other devices/techniques allow for riffs to be played along with a chord.