Whenever there is a deviation arb guys come in and take positions in such a way that it dissapears.
So for example, if Nify is at 8000 and Nifty this month futures suddenly becomes 8100 (which is clearly overpriced). You can buy all the Nifty 50 stocks in the same % proportion as how index is created to synthetically create a long Nifty index affect and at same time short Nifty futures at 8100. There will be many people who will come and keep doing this until that gap dissapears.
In this world of technology and High frequency trading, such gaps get adjusted in seconds if not milli/micro seconds.