-다가 breaks off in the middle of something and 끝나다 ends it, so the effect is of a thing fizzling out rather than reaching a proper finish. These lines are a friendship that just drifts apart, a conversation that stayed on pleasantries and stopped, a game played in a daze until it was over. 그러다가 끝나다 — 'and then it just ends' — is the stock phrase for it.