All plays a major role in SEO. I’ll discuss all the terms related to keyword one by one. Many people stuff the keywords in the web page, but it is not a good thing. Stuffing of keywords comes under the category of BlackHat SEO.
Keyword density is the percentage of periods a keyword is found on your web page. In simple words, it is the ratio of the number of keywords and the total number of words. For example, if you have a page of 100 words on it including title, alt text of images, and you have a keyword that is on the web page 2 times, then your keyword solidity is 3%.
Keyword Density= (number of keywords/ total number of words) *100
I would like to mention here that keyword density should not be more than 2 %. There are many tools to find the density of the keyword. I prefer SEO Checker to check the keyword density.