Well, Handbrake reencodes the video, so there will be a drop in quality to some degree. How much of a drop depends on your encode settings. If you’re just loading up the file and clicking “start,” you’re gonna end up with a not-super-great encode.
In my experience, find the bitrate of your source file and use a bitrate of about 500kbps higher than that. Use 2-pass encoding, and turn your encoder preset down to a slower setting (the slowest setting you can stand, really). That should give you an output file that’s roughly the same quality as your original.
Oh, and make sure you’ve turned off everything under “filters” and have your framerate/FPS set to whatever the framerate of your source file is. I don’t know how much “constant” versus “variable” framerate matters, but I’ve always checked “constant” and had no problems.
For audio, if you want to keep the same level of quality, it’s actually pretty damn easy. In the audio tab, there’s a drop-down menu labeled “codec” - just choose the “passthru” option that matches the source format (so, for instance, if your source audio is AC3, choose AC3 passthru; if it’s MP3, choose MP3 passthru; if it’s AAC, choose AAC passthru; and so on).
If you don’t know where to find any of this information for your source file, download MediaInfo and use it to open your file - it’ll give you all that information and more.