You're probably referring to the default matchparen plugin, which highlights (
and the corresponding )
; see :help matchparen
.
There is no general solution for other (larger) pairs (such as begin
.. end
). However, there exist some special solutions for particular filetypes, e.g. MatchTag for opening / closeing HTML tags.