Jonah realized that the Lord had kindly saved him by sending the fish. He then created a prayer similar to a psalm. The prayer's careful structure follows the pattern of a personal song of thanks. This suggests Jonah may have written it after the event, as he remembered his feelings and worries.