Merging in cosmic structures