Thanks to @nanny!
I found the answer in the mailing list which he mentioned in the comment!
save-excursion stores a marker, not the 'byte' number. When you kill
the line where point is, this marker gets replaced to the beginning of
the line.
(From: Andreas Politz)
From Elisp Manual [ (info "(elisp)Excursions") ]:
Warning: Ordinary insertion of text adjacent to the saved point value
relocates the saved value, just as it relocates all markers. More
precisely, the saved value is a marker with insertion type nil. See
Marker Insertion Types. Therefore, when the saved point value is
restored, it normally comes before the inserted text.
Then another one explanation which makes the answer clearer.
Here's a simple example that may help. Suppose you have a buffer
containing:
1 abcdef
2 123456
3 wxyz
and point is on line 2 between 3 and 4. You write a function that
uses save-excursion while it deletes line 1. When the save-excursion
ends, point will still be between 3 and 4, although this will now be
line 1.
The intent is to continue pointing to the same text that it originally
pointed to. But if that text itself is deleted, this is obviously not
possible. Any markers that were within the deleted text will end up
pointing to the place where the text used to be.
(From: Barry Margolin)
Now I see, if I want to put point on the same position as it was before editing I need to save that position and then just execute (goto-char saved-position)
.
Thank you all!