Ainu is not related to Japanese. It shares no grammar with it and no inherited vocabulary, and the words the two languages hold in common travelled between neighbours rather than down from a common ancestor. Attempts to attach Ainu to a wider family have been made repeatedly, toward the Altaic grouping, toward Austroasiatic, toward Austronesian, and none has been accepted. It stands as an isolate, and the honest description of it is that its relatives, if it had any, are gone.
Its own grammar is unlike that of its neighbour in ways that matter for reading its literature. Ainu is polysynthetic: a single verb can carry the subject, the object, the applicative that says what the action is done with or for, and the incorporated noun, so that a clause in Ainu can correspond to a sentence in English. Person is marked on the verb, and the marking distinguishes a form used when the speaker is narrating as someone else, which is precisely the form the epics need.
There were three main varieties, in Hokkaido, in Sakhalin and in the Kurils. The Sakhalin and Kuril varieties have no remaining speakers. Hokkaido Ainu was itself dialectally diverse, and what is documented is uneven, because the recording was done by outsiders at different dates and with different interests.
Ainu had no script of its own. It has been written in the Japanese katakana syllabary, which suits it poorly, and in Latin transcriptions devised for dictionaries and for the publication of oral literature. Almost everything the atlas can say about Ainu religion passes through one of those transcriptions.