It is not clear to me how the FE demeaning mechanically affects an estimation, especially with respect to a difference-in-differences estimation.

To clarify things, I created a toy data set to test what goes on when I use FE in a DiD regression, with twelve observations in two states and three sectors where I observe an effect in only one state-sector pair with on pre- and one post- entry per observation (dataset printout below).

If I run a simple DiD regression:

xtset firm_id
xtreg y i.treat i.post i.treat##i.post, vce(cluster firm_id)


the interaction effect comes out as 0.5. This being (mechanically) the effect in the only state-sector pair (i.e. 3), by the number of pairs (6).
However, when I add state FE and sector FE:

xtreg y i.treat i.post i.treat##i.post i.sector i.state, vce(cluster firm_id)

it is not clear to me how Stata calculates them, and why the interaction effect in the estimation does not change (when it does in the real dataset I work with).

firm_id post treat y sector state
1 0 1 1 a s_1
2 0 0 0 a s_1
3 0 1 1 a s_2
4 0 0 0 a s_2
5 0 1 1 b s_1
6 0 0 0 b s_1
7 0 1 1 b s_2
8 0 0 0 b s_2
9 0 1 1 c s_1
10 0 0 0 c s_1
11 0 1 1 c s_2
12 0 0 0 c s_2
1 1 1 5 a s_1
2 1 0 1 a s_1
3 1 1 2 a s_2
4 1 0 1 a s_2
5 1 1 2 b s_1
6 1 0 1 b s_1
7 1 1 2 b s_2
8 1 0 1 b s_2
9 1 1 2 c s_1
10 1 0 1 c s_1
11 1 1 2 c s_2
12 1 0 1 c s_2