how did the psychology developed as a field of science is understanding behavior?

how did the psychology developed as a field of science is understanding behavior?