I wrote a plugin for Reaper. Basically, I give it 8 samples to use and a pattern to play (e.g. play on beats 1, 3, and 4 for two measure or play on every beat and offbeat for one measure, etc.), and each time the song plays, it takes some combination of its samples and plays them on the appropriate beats. Then it loops that measure or two. In any given recording, I have 3 to 5 ish of these loops switching on and off throughout.
The synthesizers are also randomized, but that's more like an arpeggiator with a randomized order.