It is sometimes needed to add an object in an image and make it look part of it by appearing behind foreground elements and in front of background elements. With the proper technique this isn't difficult:
In that specific case:
- Add the object in a new layer
- Duplicate the image layer
- Move the copy above the object layer (which is sandwiched between the two images)
- Using a layer mask, erase the top image except where it is in the immediate vicinity of the object: you start by removing most of the image (big brush or bucket-fill with a selection), remove most of the rest with a small brush, and shave off the outline where needed with a soft brush.
- The only place where erasure should be accurate is where a foreground element intersects the inserted object
In that specific case:
- The layer group is not strictly necessary. It is used for demo purposes so the group thumbnail shows the effect of the mask
- You can see how little of the "copy" you need
- The image a good example... cutting out the whole cat properly with all the hairs would have been a daunting task (1600 pixels of fuzziness). But here the only place where we need a sharp cut in on the ears, which are not fuzzy (200 pixels of sharpness), as shown by the red lines below: