The surname is habitational, from any of various places named with a Middle High German derivative of einsteinen ("to enclose or surround with stone"), cp. ein-, Stein and -en, or from ein + Stein.
The "an extremely intelligent person" sense is an eponym of Albert Einstein.