There's no clear cut answer. I've always though of it as a combination of technology and style. By that I mean, there are shared technological elements (such as geometry of the ship for best warp drive, placement of nacelles and deflector dish, standardization of replacement parts, et cetera) that influence the similarity of ships, but also a conscious aesthetic drive to make the fleet look similar.
That being said, there is still some pretty big gap. Compare, for example, the Defiant, the Prometheus, and the USS Pasteur. Compared independently, they look totally different - you only start to notice similarities in the context of all the other ships.