Layer2 extends one subnet to multiple locations, which includes broadcast traffic. Layer3 routes, each location will have it’s own ip range.
See these great articles.