If you are only getting one, or the other, make sure that ALL the games you want to play will use the one you get.
There are games out there that will ONLY accept keyboard commands, and others will ONLY accept gamepad commands.
You can get software like Joy2Key that will overcome this, but it's alot easier to just use something that is compatible natively.
If I were only buying one of the two, I'd get a keyboard encoder.
Most software will allow keyboard control, and may have necessary commands that are not remappable.
A good example of this is the entire Digital Leisure series (Mad Dog McCree, Last Bounty Hunter, etc...).
These all require that you press "F" to go to full screen mode, and "Alt-F4" to quit, etc...
If all you have is a gamepad encoder, you will have to use the conversion software above to get the gamepad commands to map over to keyboard commands.
There are very few games that will ONLY accept gamepad commands, however.
Adding gamepad encoders in parallel with a keyboard encoder works great.
The only issues I've run into with it is that I need to be careful about what I plug in, and unplug to keep the joysticks from swapping ID's.
I don't have all that hardwired into a cabinet yet, so I am swapping individual control panels, at this point.