What happens if you are playing against someone, and a bystander who can see your hand says something along the lines of "good thing you have mana leak in your hand" or just mentions a card you have. Also, what if you know that the person giving the information is the friend of your opponent, but have no idea if your opponent put them up to it.
Under the Magic Tournament Rules, during a sanctioned tournament:
Spectators are responsible for "remaining silent and passive during matches" (M.T.R. 1.10) and "may not give Magic-related advice to players" during matches (M.T.R. 5.6). This is true regardless of the spectator's relationship to any of the players.
Players that notice any "rules or policy infraction ... in their matches" are responsible for "calling attention to" it (M.T.R. 1.10). Judges "intervene as soon as a rule has been broken or to prevent a situation from escalating" (M.T.R. 1.8).
How would the judges intervene and what if it does significantly hurt the player whose information was revealed.
The answer depends on the particular facts and circumstances of the situation you gave in comment 1. In tournaments at Competitive or Professional rules enforcement level, depending on those facts and circumstances, a judge may assess an Outside Assistance infraction against the spectator. If so, the spectator "may be asked to leave the venue", again, regardless of the spectator's relationship with any of the players (I.P.G. 3.2). On the other hand, tournaments at Regular rules enforcement level are "focused on fun and social aspects, not enforcement" (M.T.R. 1.12).
EDIT: Clarification after comment 3 was posted.