Overfitting mainly occurs when the ML model uses data with a lot of noise in it. The data must have high variance and low bias to be able to produce an overfitting model. Visually, It will be visible how the model fits the data a little too well which ultimately hampers the accuracy score of the model.
Underfitting of a model happens when the underlying trends of the data go unaccounted for. Data of this sort of a model has low variance and high bias. It usually happens when the model is very basic in nature.
To get a better understanding of Machine Learning basics, have a look at this video