This question already has an answer here:
- Select 1px aliased border 2 answers
Why can't I get a hard border when I used modify -> border? This is maddening and I've read about 5 posts so far that do not solve the problem?
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
If you input a 4px border, you get 2 pixels inside the document and 2 pixels outside the document. PLUS 2px of anti-aliasing inside the document and 2px of anti-aliasing outside the document. So basically you get the value you input inside the document edges, but half the value is used for anti-aliasing. That's simply how the command works.
If you fill the border selection with a solid color, you see half the value in anti-aliasing. So, in the sample 4px border, you get a 2px selection inside the document, then 2px of anti-aliasing.
Repeatedly filling the selection will eventually result in a hard-edged border by filling those 2px of anti-aliasing space.
Why does this happen? I have no idea. There's certainly no way to alter the behavior of the Border command.