The total sum of squares for the variable being predicted is as the following: $$\mathrm{TSS}=\sum_{i=1}^{n}\left(y_{i}-\bar{y}\right)^2$$ and the residual sum of squares from the predictions from your model $$\mathrm{RSS}=\sum_{i=1}^{n}\left(y_{i}^{\,}-\hat{y}_i\right)^2$$ then: $$R^2 = 1-\frac{\mathrm{RSS}}{\mathrm{TSS}}$$
When $$R^2=1$$
We may have an over fitted model, and some of the features should be analyzed (using correlation) and to be later removed, and recalculate the $R^2$.
The adjusted $R^2$ is: $$adjR^2 =1 - (1-\frac{\mathrm{RSS}}{\mathrm{TSS}})*\frac{\mathrm{n-1}}{\mathrm{n-p-1}}$$
Where $n$ is the number of samples used, and $p$ is the number of features used.
When $p$ increases, the denominator decreases, which lead to the whole fraction to increase. Thus, $adjR^2$ decreases according the formula.
But isn't it that increasing the number of features of a model result an over fitting, which lead to inaccurate prediction? Or the overfitting only affect $R^2$?