Keyword density is an indicator of the number of times the selected keyword appears in the web page. But mind you, keywords shouldn’t be over used, but should be just sufficient enough to appear at important places.
If you repeat your keywords with every other word on every line, then your site will probably be rejected as an artificial site or spam site.
Keyword Density is the percentage of occurrence of your keywords to the text in the rest of your webpage. It is important for your main keywords to have the correct keyword density to rank well in Search Engines.
You can calculate the keyword density within your article by dividing the number of times that each keyword or keyword-phrase occurs by the number of the total words in the entire article.
For example, a 300-word article that mentions a particular keyword 15 times has a keyword density of 5%. An article with a 1% - 5% keyword density resembles the natural flow of regular speech. But when that density is increased to 10% or 20%, the article becomes incomprehensible and 'spammy.'
Note : The accepted standard for a keyword density is between 3% and 5%, to get recognized by the search engines and you should never exceed it.
It also applies to not just to one keyword but also a set of keywords that relates to a different product or service. The keyword density should always be between 3% and 5%.