In former days it was used as a bad word for describing the alleged black Americans odor. About the late 50ties black people in America adapted the word and turned it into something positive (like say did with other words as well like 'bad'). So it became an expression reserved for black people meaning their lifestyle and upcoming self-confidence. Especially in Jazz music at that time it was a new style/type of playing called funky (e.g. Horace Silver and Jimmy Smith) which found it's way in the 60ties into R'n'B music and led to the creation to Funk music in the late 60ties with protagonists like James Brown, the meters, sly and the family stone and the bar kays... Funk had it's peak between the early and midseventies, before Disco came as a kind of fake-funk. Funk also can be seen as predecessor for Disco and for contamporary musical styles like Hip Hop, Acid Jazz, Drum'n Bass, House, Big Beat and Crossover/Funkrock/Funkmetal. Which (exept the latter) all sample Funk Music.
James Brown: "It's got to be funky" and "Make it funky"
Lee Dorsey: "Everything I do gonna be funky from know on"
"James Brown's "the funky drummer" is one of the most sampled Funk songs"