Clicking on dock icon makes windows for other applications disappear
It appears that Single Application Mode has been activated. Open /Applications/Terminal and copy the following command:

   defaults write com.apple.dock single-app -bool false killall Dock


To reverse this, replace false with true.

Alternate GUI Way

You can also Option + Click the app icon in the dock to reverse the behavior.