The mice class implements a method to deal with missing data. Its creates multiple imputations (replacement values) for multivariate missing data.
The method is based onLiner Regression,The MICE algorithm can impute mixes of continuous, binary, unordered categorical and ordered categorical data. In addition, MICE can maintain consistency between imputations by means of passive imputation.
Also you couls reference this paper to understand its principle: