Welcome to Android Central! rvbfan is correct -- what you're seeing is Factory Reset Protection, which is intended to discourage thieves from simply stealing a phone and doing a factory reset to make it their own. If the previous owner didn't do a proper factory reset (which requires entering their password), then any unauthorized factory reset will be met with a requirement to enter that password.