It's making sure that the blocks that it downloaded have valid data;
Furthermore, each block is liked with the previous block via its hash so if there's a discrepancy, it wont be able to reach the tip.
But if you want to make sure that there's no discrepancies in your blockchain including the scripts:
You may consider setting assumevalid=0 config or -assumevalid=0 command line option
That will set your node to fully verify all the blocks starting from from the genesis block.
Then use -reindex to validate your already downloaded blocks. (it will be slower than usual)