They are used in space because it is much more difficult to use solar beyond Mars. Modern solar has helped in Jovian missions but RTGs are still preferred (even Curiosity uses a RTG for low solar radiance reasons). And beyond Jupiter good luck having a powered device with anything except for a RTG.
yes of course, what I mean is why the space RTGs are so much more expensive than terrestrial RTGs, where weight is not a consideration. For space, it makes sense to use the exotic plutonium isotope if it saves on weight.
Oh yes. Another thing to consider is the weight of the titanium that encases the RTG just so you don't fry the other electronics. Dealing with radiation in space is pretty difficult and radiation shielding in general is still a pretty complex problem. On Earth we pretty much solve it my mass (more mass == more shielding) but we don't have the luxury with space applications. There's a lot of advanced composites there and layered material. It is a really fascinating subject. There's also people trying to harvest some of this energy into usable electricity. I worked on one of these devices (focusing on betavoltaics) and it isn't going to power your house, but you can power things like a heartbeat signal for your craft (and of course use it to trickle charge batteries on long missions).
I don't work in this space anymore. Some I can't talk about but part of what I can talk about is still a pretty big problem, which is finding layer ordering, materials, thicknesses, etc of the shielding. You have problems like that neutrons are absorbed differently than protons, alpha particles, and beta particles (all those are charged). So you want to use thing like hydrocarbons for neutrons (read plastic) and you probably want to dope it. BUT there's a big problem that the energy level matters a lot. Gadolinium is known as having a good neutron cross section, but that is only for thermal neutrons and hot neutrons (as you'd find in space) don't see gadolinium differently from dense materials like titanium and aluminum (good for charged particles). So the problem is to layer, dope, etc. And to do that while accounting for secondary factors like that you can have materials become hot as exposed to radiation and then you also have to consider physical shielding. The solution space is extremely large and you search it by simulation.
As for getting electricity you can probably imagine that if you have two conductive plates that they will get charge levels across them and that's a capacitor. There are other ways to extract energy though and finding ways to do this is very helpful. But there is a theoretical limit to the energy and don't expect to replace solar panels unless you can capture those particles and use a nuclear process instead of an electromagnetic one.
If you're interested in this start searching for betavoltaics[0]. That uses the E&M process whereas an RTG uses a thermal process. There's nothing stopping you from using both though.