the focus command will come from the camera's electronics, but the optical focussing of the light rays is done by the lens - the sensor captures the light as directed on it by the focussing of the various lens elements, and process them to give us the picture file
Yes, we all know this, it's the whole point of having a lens. Nevertheless, it is the camera body that tells the lens how to focus, in what direction, by how much. For mechanically driven lenses, it's not even up to the lens - the camera body directly manipulates the focusing elements in the lens.