Banns are a hold-over from the days when people tended to be born, live, and die in the same village or parish. The purpose was to find out if anyone in the community was aware of any legal impediment to the proposed union, such as previous (or existing!) marriage or close kinship or some other problem that would make the union unlawful.
It is the month-long equivalent of the “if anyone has just cause why these two should not be joined, let him speak now…” cliche.
It serves the same purpose today. If you see some banns printed in your church bulletin, but you know that the couple are, for example, Aunt and nephew (ewwww), it is your responsibility to go to the pastor with that information. (As a much less disturbing example, perhaps you know that the groom was previously married.)