You hold a bunch of keys, and the arpeggiator turns them into a riff, based on certain rules. For example, you play B3, E4, G4 and B4, set the arpeggiator to "down", and get the arp from your example. The arpeggiator goes through all the notes currently held, starts at the highest and goes down to the lowest, then repeats. Other modes use other rules, like starting at the bottom or playing random selections from the notes held.
Other, more complex arpeggiators take MIDI files as rule inputs, or allow you to specify note offsets and lengths within their own user interface.