Has nothing to do with genders, but with the location of the word
After a preposition, it becomes diacriticized down •••> أنا مع ابنِك ( I'm with your son )
(Diacriticized down is the ن under which a كسرة ( ِ ) is found, as in ابنِك )
As an object, it becomes diacriticized up •••> وجدت ابنَك ( I found your son )
(Diacriticized up means a فتحة ( َ ) is placed above the ن )
Whatever "ibn" may be shaped, the ك has a whole separate story.
If the ك is referring to a [male's] son , it becomes [ كَ ] and if it's referring to a [female's] son, it becomes [ كِ ].