What does John 10:17-18 mean?

17 Therefore doth my Father love me, because I lay down my life, that I might take it again. 18 No man taketh it from me, but I lay it down of myself. I have power to lay it down, and I have power to take it again. This commandment have I received of my Father. (John 10:17-18 KJV)

William Burkitt’s Commentary

Hence note, 1. That Jesus Christ certainly foreknew his own death and resurrection.

2. That Christ was a volunteer in dying, He laid down his life, none could have taken it from him. ‘Tis true, his death was a violent death, but a voluntary sacrifice; he died violently, but yet voluntarily: the hand of his enemies could never hurt him without his own consent.

3. That as Christ died voluntarily with respect to himself, so in a way of subjection to his Father’s command. This commandment have I received from my Father.

4. That this voluntary submission of Christ to die for us, was the ground of his Father’s love to him. Therefore doth my Father love me: because I lay down my life. Although the Father had many reasons to love the Son, yet none was stronger than this obedience of his to death, even the cursed death of the cross, for the redemption and salvation of lost sinners; therefore did the Father love him with a more exceeding love, because he laid down his life for his sheep.