When you walk a thin line between something, what you are doing is performing a balancing act. You are caught between two individuals or groups who have radically different views about something. You do your job by treading carefully: you try your best not to annoy or anger the two individuals/ groups. The expression `to walk a fine line’ has the same meaning. I understand that both these expressions come from the world of tightrope walking.

e.g. The Minister knew that he had to walk a fine line between the striking workers and the Management.