Why I can get a key from frequency in Caesar Cipher?
This will make it more clear:

A B C D E F G H I J ...
0 1 2 3 4 5 6 7 8 9 ...


The Caesar cipher starts with the letter and goes through the alphabet using the key, wrapping around after 'Z'. So if 'I' is the most common letter then this is probably the enciphered letter 'E'. And since index('I') - index('E') = 8 - 4 = 4, that's the key that was used.

Note that E is only the most common letter for English text and only if other characters like space are not counted. It may not be the most common letter in small ciphertext.