Look at the shutter speed information in the two files. As Joove says you'll see the shutter time is longer in the second shot. That's what is allowing the ambient from the window to dominate and why your brother suggested the -2 offset from the default flash calculation. In the first shot the flash appears overpower the ambient completely.

Conceptually the technical reason to use flash at all is when exposing for highlight detail does not record detail in the shadows: scene range in f/stops exceed sensor range in f/stops. In situations like that you'd want to put the ambient light behind the subject as you have here as "rim" light so the flash will not overlap much, then USUALLY add the flash to the front side from ABOVE the lens (not off to the side). You then adjust the flash offset until the highlights on the flash lit side are exposed correctly.

Why not put the flash off the side as you did here in the second shot? Because a flash off to the side will create shadows the camera sees and those shadows will not have detail UNLESS flash footprint is spilling off the opposite wall and ceiling creating "spill fill". It worked here from the left and behind because from the look of the shadows in both shots you appear to have lots of "spill fill" or fill from some other source putting detail in the black objects it the flash on the left isn't hitting directly.