Ai means: 'Auto indexing', and is a mechanism through which the Nikon camera 'knows' what aperture is set by the user......
Non-Ai consists of a pin on the camera body that connects to its internal metering system. This pin goes into a rabbit earlike metal sleeve on top of the lens aperture ring, typically you need to set the aperture at F5.6 prior to inserting it on the camera body, but this need not be done for the latest non-Ai version of the Nikon F meterhead (FTn head).......
Ai consists of a protruding piece of metal at the rear of the lens aperture ring that hits a ring around the lens mount of the Nikon camera. This ring is connected to the cameras internal metering system.
AiS is the same as Ai but it has a small piece of metal cut out in the lens mount and an extra protruding piece of sleeve that hits another pin on the camera body to inform the camera what the largest aperture of that lens is.....all AiS lenses has an orange coloured smallest aperture number on the ring.