Why is "k" added to "panic" when suffixes added (as in "panicky")?

Solution 1:

Because that is the standard rule in English. The OED says:

Hence, in modern English, C has

  • (1) the ‘hard’ sound [k] before a, o, u, before a consonant (except h), and when final, as in cab, cot, cut, claw, crow, acme, cycle, sac, tic, epic;
  • (2) before e, i, y, it has the ‘soft’ sound [s]. In all words from Old English or Old French, final c is avoided: the [k] sound being written k or ck, as in beak, meek, oak, book, bark, balk, bank, pack, peck, pick, rock. This is probably due to the claims of derivatives like meeker, oaken, barking, rocky, where c could not be used. Final c however is written in modern words from Latin, Greek, or other languages, and (of late) in the ending -ic, as in sac, tic, epic, critic, music, picnic. In the rare cases in which this c is followed in inflexion by e or i, it is necessary to change it to ck, as in physicking, mimicking, frolicking, trafficker, picnicker. When the [s] sound is final, it must be written ‑ce, as in trace, ice, thrice, and this final e must be retained in composition before a, o, u, as in trace-able, peace-able.
  • (3) Ci (rarely ce) preceding another vowel has frequently the sound of [ʃ], esp. in the endings ‑cious, ‑cial, ‑cion, as atrocious, glacial, coercion (ocean). This sound (which is also taken by t in the same position) has been developed in comparatively modern times by palatalization of [s]. In a few words from foreign languages, c retains the foreign pronunciation, as in It. cicerone [tʃitʃeˈrone].

Which leads us to examples like colicky, havocker, picnicky, plasticky, panicking, picnicking, panicky, magicked, colicking, picnicked, bivouacking, colicked, mimicked, frolicked, picnicker, demosaicked, garlicky, mimicker, havocking, bivouacked, demosaicker, havocked, panicked, mimicking, frolicking, demosaicking.

Yes, you will sometimes see words like those misspelled without the protective k, but that’s like spelling the plural of bunny as *bunnys instead of as bunnies: it’s just plain wrong. We do not do things that way in English.

Solution 2:

A reason for this might be that not adding the k means the c is reverted back to its soft sound.

For example the word Racy has a soft c, if Panic was turned into Panicy it would be pronounced

Pani-see.

If panicing was used instead of Panicking it would be pronounced Pani-sing.

The addition of the k keeps the c as a hard c such as in words like click

I beleive this is because the addition of the vowel (a,e,i,o,u) or y after the c causes it to default to a soft c sound.

In words where a vowel (or y) doesnt follow the c then no k would be added. For example

the word panic becomes panics but the c retains its hard c sound