this may or may not have been discovered, but perhaps some discussion and trials of the community might shed some light. the meg seems to be quite random, whether it pops up and hangs around or decides to attack you. lately ive just been sailing around trying to get the sailor of Athena commendation (want the capstan) and run into the meg often and have started to notice a few things.
now typically I leave the meg alone and sometimes it attacks sometimes it doesn't, sometimes I attack it and after a couple hits it swims away. but a big key factor ive been noticing is the presence of treasure on board. Ive come to believe the meg is attracted to treasure.
this can be very helpful in determining your voyage and understanding the outcome. if you dont want to be attacked by the meg it may not be from you attacking it, rather it is also another entity that just wants what you have.
I cant say this with any certainty, just speculation at this point, but perhaps with enough people running their own tests maybe we can figure it out together. unless this has already been figured out and I have just wasted your time in reading this lol