"in" as it relates to time means "right after".
"in 3 days" means after day 3 starts but usually before it ends.
"within" is used when you want to say something is in the 3 days, not after. IE, it can be on day 1, day 2, or day 3.
"something happens in 3 days" - something happens on day 3.
"something happens within 3 days" - something happens on either day 1, day 2, or day 3.
Idk why English is like this, where "in" means "after" when it relates to time but it is.