There are a few steps, some applications are separate like ripping and compression then some are combined all in one.
Handbrake is the easy way to start off if not wanting to pay for anything, MakeMKV is also a free way of transferring DVD/BD to HDD for Handbrake to compress, but if you want an all in one which will do the job then DVDFab Ripper Suite (covers DVD/BD) is one to go with but is a commercial app.
Stick with mp4 as the output as that is natively supported by tablets so you wont need third party media players.
There are a lot of factors which affect how small a movie can go and retain image quality
* which preset is being used, In Handbrake for example Android preset would give lower image quality than high profile preset as HP uses more features of H.264 to retain image quality.
* most H.264 encoders use an encoding mode called constant quality, your effectively setting a quality bar and asking the encoder to stick to that no matter what, some movies as a result compress really well but others don't depending upon the source material. Most encoders use a CQ setting of 20, 18 is considered almost near identical to the original video, higher values will result in smaller files but I wouldn't go any higher than 23-24.
* some x264 encoders also offer further fine tuning for squeezing out the maximum quality, they offer content type presets like film, animation and encoding speed (only nightly builds of Handbrake expose this), you could set those that to Flim with to slow or slower to get a bit more out of the video at a cost of time of course.