What is the use of _isVaultCollateralized() function in ERC4626 Tokenized vaults

I am having a doubt in erc4626 vault contract . why do we need _isVaultCollateralized() function in maxdeposit() function

 function _isVaultCollateralized() private view returns (bool) {
        return totalAssets() > 0 || totalSupply() == 0;
    }
 function maxDeposit(address) public view virtual override returns (uint256) {
        return _isVaultCollateralized() ? type(uint256).max : 0;
    }

why cant we just return type(uitn256).max ?

Without the check, deposit would trigger a division by zero. See this note:

Note that the security of the vault isn't compromised if we remove that check, but maxDeposit would be lying if it returned a non-zero value. Any non-zero value would cause deposit to revert. The EIP does not like reverts like that.