Most important is to understand why it looks like this. As pointed out, vertices that share the same position but hold a different face are not welded together. The lightning is calculated individually per vertex group. By merging you replace all vertices that share the same position by one vertex, and this the model becomes one group of vertices. Then the algorithm to calculate smooth lightning can do its job properly

.