In general it will be easier to get help with a minimal reproducible example, or reprex. Sometimes making one will even show you where the problem is, which is always a great feeling!
I tried to make some fake data to reproduce your problem. If this not an accurate representation, please post some more detail about your problem:
library(tidyverse)
df1 <- tibble(grp = c(rep(1, 2), rep(2, 3)), contract = c(1:2, 1:3))
df2 <- tibble(grp = 1:2, value = c(173, 2142))
df1 %>%
group_by(grp) %>%
mutate(ct = n()) %>%
left_join(df2, by = "grp") %>%
mutate(prop_value = value / ct)
#> # A tibble: 5 x 5
#> # Groups: grp [2]
#> grp contract ct value prop_value
#> <dbl> <int> <int> <dbl> <dbl>
#> 1 1 1 2 173 86.5
#> 2 1 2 2 173 86.5
#> 3 2 1 3 2142 714
#> 4 2 2 3 2142 714
#> 5 2 3 3 2142 714
Created on 2021-05-21 by the reprex package (v2.0.0)